3da8b24e39dec548fe9a866c1f875dffa5dfbab0,core/baseLanguage/baseLanguage/solutions/jetbrains.mps.baseLanguage.refactoringTest/source_gen/jetbrains/mps/refactoringTest/SimpleFindForExtractFromStatement_Test.java,TestBody,test_SimpleFindForExtractFromStatementTest,#,30

Before Change


    public void test_SimpleFindForExtractFromStatementTest() throws Exception {
      this.addNodeById("8556882668095222065");
      this.addNodeById("8556882668095222149");
      ExtractMethodRefactoringParameters params = new ExtractMethodRefactoringParameters(ListSequence.fromListAndArray(new ArrayList<SNode>(), SNodeOperations.cast(this.getNodeById("8556882668095222071"), "jetbrains.mps.baseLanguage.structure.ExpressionStatement")));
      params.setName("print");
      ExtractMethodRefactoring ref = ExtractMethodFactory.createRefactoring(params);
      SNode res = ref.doRefactor();
      for (MethodMatch match : ListSequence.fromList(ref.getMatches())) {
        ExtractMethodRefactoring matchRef = ExtractMethodFactory.createRefactoring(new ExtractMethodRefactoringParameters(match.getNodes()));
        matchRef.replaceMatch(match, res);
      }
      Assert.assertEquals(null, NodesMatcher.matchNodes(ListSequence.fromListAndArray(new ArrayList<SNode>(), SNodeOperations.cast(this.getNodeById("8556882668095222066"), "jetbrains.mps.baseLanguage.structure.ClassConcept")), ListSequence.fromListAndArray(new ArrayList<SNode>(), SNodeOperations.cast(this.getNodeById("8556882668095222150"), "jetbrains.mps.baseLanguage.structure.ClassConcept"))));

After Change


    public void test_SimpleFindForExtractFromStatementTest() throws Exception {
      this.addNodeById("8556882668095222065");
      this.addNodeById("8556882668095222149");
      ExtractMethodRefactoringParameters params = ExtractMethodFactory.createParameters(ListSequence.fromListAndArray(new ArrayList<SNode>(), SNodeOperations.cast(this.getNodeById("8556882668095222071"), "jetbrains.mps.baseLanguage.structure.ExpressionStatement")));
      params.setName("print");
      ExtractMethodRefactoring ref = ExtractMethodFactory.createRefactoring(params);
      SNode res = ref.doRefactor();
      for (MethodMatch match : ListSequence.fromList(ref.getMatches())) {
        ExtractMethodRefactoring matchRef = ExtractMethodFactory.createRefactoring(ExtractMethodFactory.createParameters(match.getNodes()));
        matchRef.replaceMatch(match, res);
      }
      Assert.assertEquals(null, NodesMatcher.matchNodes(ListSequence.fromListAndArray(new ArrayList<SNode>(), SNodeOperations.cast(this.getNodeById("8556882668095222066"), "jetbrains.mps.baseLanguage.structure.ClassConcept")), ListSequence.fromListAndArray(new ArrayList<SNode>(), SNodeOperations.cast(this.getNodeById("8556882668095222150"), "jetbrains.mps.baseLanguage.structure.ClassConcept"))));